<template>
	<view class='page_cont'>
		<view class="audi_wrap" v-if="type==1">
			<view class='audi_img_box'>
				<image class='img' src="https://ossdev0.jiabala.com/Js2ywFibaPsBA"></image>
			</view>
			<view class='text1'>机构认证不通过</view>
			<view class='text2'>原因如下：{{result?result:''}}</view>
			<view class='btn' @click="add_again()" v-if="status==1">确定</view>
			<view class='btn_wrap' v-if="status==2">
				<view class='button' @click="add_again()">确定</view>
				<view class='button qie' @click="check_identity()">切换教师身份</view>
			</view>
		</view>
		<view class="audi_wrap" v-else-if="type==2">
			<view class='audi_img_box'>
				<image class='img' src="https://ossdev0.jiabala.com/QX8Fmb6QpkbGh"></image>
			</view>
			<view class='text1'>机构认证成功</view>
			<view class='text2'>恭喜您，资料审核通过</view>
			<view class='btn' @click="nav_detail()" v-if="status==1">去绑定机构</view>
			<view class='btn_wrap' v-if="status==2">
				<view class='button' @click="nav_detail()">去绑定机构</view>
				<view class='button qie' @click="check_identity()">切换教师身份</view>
			</view>
		</view>
		<view class="audi_wrap" v-else>
			<view class='audi_img_box'>
				<image class='img' src="https://ossdev0.jiabala.com/mkpWBaKnawDmC"></image>
			</view>
			<view class='text1'>机构认证审核中</view>
			<view class='text2'>资料提交成功，待管理员审核</view>
			<view class="btn" @click="nav_index()" v-if="status==1">进入首页</view>
			<view class="btn" @click="check_identity()" v-if="status==2">切换教师身份</view>
		</view>
	</view>
</template>

<script>
	import config from "../../api/config.js"
	export default{
		data(){
			return {
				type: '',
				status: '', // 1-已有老师身份  2-无身份者
				id: '',
				result: ''
			}
		},
		onLoad(options) {
			this.type=options.type;
			this.status=options.status;
			if(options.id){
				this.id=options.id
				if(options.type==1){
					this.get_org_type(options.id)
				}
			}
		},
		methods:{
			//重新认证
			add_again(){
				// uni.navigateTo({
				// 	url: '../addMech/addMech'
				// })
				uni.redirectTo({
					url:"/pages/bindUnit/bindUnit"
				})
			},
			// 去绑定
			nav_detail(){
				// uni.navigateTo({
				// 	url: '/pages/mechDetail/mechDetail?id='+this.id+'&type=2'
				// })
				uni.navigateTo({
					url: '/pages/bindUnit/bindUnit'
				})
			},
			// 回首页
			nav_index(){
				uni.switchTab({
					url: "/pages/index/index"
				})
			},
			// 切换身份
			check_identity(){
				uni.navigateTo({
					url: '/mypage/myDom/myDom'
				})
			},
			get_org_type(id){
				config.get_org_type({"businessId":id}).then(res=>{
					this.result=res.data.data.result
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		background: #fff;
		.page_cont{
			padding: 110rpx 0 0 0;
			.audi_wrap{
				width: 100%;
				.audi_img_box{
					margin: 0 auto;
					width: 212rpx;
					height: 212rpx;
					.img{
					  width: 100%;
					  height: 100%;
					}
				}
				.text1{
					height: 56rpx;
					font-size: 40rpx;
					font-weight: 600;
					line-height: 56rpx;
					color: #3F4A58;
					text-align: center;
					margin: 28rpx 0 12rpx 0;
				}
				.text2{
					text-align: center;
					height: 34rpx;
					font-size: 24rpx;
					font-weight: 400;
					line-height: 34rpx;
					color: #999999;
					margin-bottom: 64rpx;
				}
				.btn{
				  width: 334rpx;
				  margin: auto;
				  height: 88rpx;
				  line-height: 88rpx;
				  background: #5B90FF;
				  border-radius: 16rpx;
				  color: #fff;
				  font-size: 30rpx;
				  font-weight: 500;
				  letter-spacing: 2rpx;
				  text-align: center;
				}
				.btn_wrap{
					margin: 0 32rpx;
					display: flex;
					flex-direction: row;
					.button{
						flex: 1;
						height: 88rpx;
						line-height: 88rpx;
						background: #5B90FF;
						border-radius: 16rpx;
						color: #fff;
						font-size: 30rpx;
						font-weight: 500;
						letter-spacing: 2rpx;
						text-align: center;
						margin-right: 18rpx;
					}
					.qie{
						margin-right: 0;
						background: rgba(146,155,167,0.15);
						color: #929BA7;
					}
				}
			}
		}
	}
</style>
